// Copyright 2012 Google Inc. All Rights Reserved.

package com.google.superlists.model;

import com.google.common.collect.Maps;

import java.util.Map;

/**
 * Bean representing the result of an action.
 *
 * @author sven@google.com (Sven Mawson)
 */
public class ActionResult {

  /**
   * Returns the action result parsed from a json string.
   */
  public static ActionResult fromJson(String json) {
    return JsonUtil.fromJson(json, ActionResult.class);
  }

  /** The id of the result. */ 
  public String id;

  /** The superlist that was created/edited/whatever. */
  public SuperList list;

  /** The map of metrics recorded in this action. */
  public Map<String, String> metrics = Maps.newLinkedHashMap();

  /** Public constructor for GSON. */
  public ActionResult() {}

  /** Returns the json representation of the result. */
  public String toJson() {
    return JsonUtil.toJson(this);
  }
}
